RRPlot and the Colon data set

Libraries

library(survival)
library(FRESA.CAD)
## Loading required package: Rcpp
## Loading required package: stringr
## Loading required package: miscTools
## Loading required package: Hmisc
## 
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:base':
## 
##     format.pval, units
## Loading required package: pROC
## Type 'citation("pROC")' for a citation.
## 
## Attaching package: 'pROC'
## The following objects are masked from 'package:stats':
## 
##     cov, smooth, var
op <- par(no.readonly = TRUE)
pander::panderOptions('digits', 3)
pander::panderOptions('table.split.table', 400)
pander::panderOptions('keep.trailing.zeros',TRUE)

source("~/Documents/GitHub/RISKPLOTS/CODE/auxplots.R")

The data set

data(cancer)
colon <- subset(colon,etype==1)
colon$etype <- NULL
rownames(colon) <- colon$id
colon$id <- NULL
colon <- colon[complete.cases(colon),]
time <- colon$time
status <- colon$status
data <- colon
data$time <- NULL
data$study <- NULL
table(data$status)

0 1 442 446

dataColon <- as.data.frame(model.matrix(status~.*age,data))
dataColon$`(Intercept)` <- NULL
dataColon$time <- time/365
dataColon$status <- status
colnames(dataColon) <-str_replace_all(colnames(dataColon),":","_")
colnames(dataColon) <-str_replace_all(colnames(dataColon),"\\.","_")
colnames(dataColon) <-str_replace_all(colnames(dataColon),"\\+","_")
data <- NULL

trainsamples <- sample(nrow(dataColon),0.7*nrow(dataColon))
dataColonTrain <- dataColon[trainsamples,]
dataColonTest <- dataColon[-trainsamples,]


pander::pander(table(dataColonTrain$status))
0 1
306 315
pander::pander(table(dataColonTest$status))
0 1
136 131

Modeling

ml <- BSWiMS.model(Surv(time,status)~1,data=dataColonTrain,loops=20,NumberofRepeats = 5)

[++++++++++++++++++++++]..

sm <- summary(ml)
pander::pander(sm$coefficients)
  Estimate lower HR upper u.Accuracy r.Accuracy full.Accuracy u.AUC r.AUC full.AUC IDI NRI z.IDI z.NRI Delta.AUC Frequency
age_nodes 6.93e-04 1.000 1.001 1.001 0.622 0.514 0.622 0.624 0.508 0.624 0.03529 0.467 6.42 6.31 0.1164 1.0
node4 3.18e-01 1.245 1.374 1.517 0.612 0.600 0.623 0.615 0.599 0.626 0.04652 0.455 6.32 6.76 0.0267 1.0
age_node4 2.76e-03 1.002 1.003 1.004 0.612 0.609 0.628 0.615 0.609 0.630 0.01951 0.416 4.80 6.29 0.0214 1.0
rxLev_5FU_age -3.07e-03 0.995 0.997 0.998 0.573 0.615 0.623 0.571 0.618 0.626 0.01923 0.284 3.92 3.78 0.0076 1.0
rxLev_5FU -1.26e-01 0.826 0.882 0.941 0.573 0.610 0.628 0.571 0.614 0.630 0.01821 0.284 3.79 3.78 0.0165 1.0
extent 1.44e-01 1.049 1.155 1.271 0.557 0.612 0.623 0.552 0.615 0.626 0.01139 0.199 2.94 3.52 0.0101 1.0
nodes 1.14e-02 1.004 1.011 1.019 0.622 0.611 0.631 0.624 0.614 0.634 0.00483 0.237 2.87 3.14 0.0191 1.0
age_extent 1.17e-09 1.000 1.000 1.000 0.539 0.507 0.539 0.539 0.500 0.539 0.00621 0.156 2.12 1.96 0.0391 0.6
age_surg 1.37e-09 1.000 1.000 1.000 0.531 0.507 0.531 0.535 0.500 0.535 0.00545 0.139 2.08 1.99 0.0349 0.6
surg 2.58e-08 1.000 1.000 1.000 0.531 0.507 0.531 0.535 0.500 0.535 0.00476 0.139 1.98 1.99 0.0349 0.2
rxLev 2.33e-08 1.000 1.000 1.000 0.531 0.507 0.531 0.534 0.500 0.534 0.00441 0.136 1.82 1.82 0.0340 0.2

Cox Model Performance

Here we evaluate the model using the RRPlot() function.

The evaluation of the raw Cox model with RRPlot()

Here we will use the predicted event probability assuming a baseline hazard for events withing 5 years

index <- predict(ml,dataColonTrain)
timeinterval <- round(2*mean(subset(dataColonTrain,status==1)$time),0)
timeinterval <- 2

h0 <- sum(dataColonTrain$status & dataColonTrain$time <= timeinterval)
h0 <- h0/sum((dataColonTrain$time > timeinterval) | (dataColonTrain$status==1))

rdata <- cbind(dataColonTrain$status,ppoisGzero(index,h0))

rrAnalysisTrain <- RRPlot(rdata,atRate=c(0.90,0.80),
                     timetoEvent=dataColonTrain$time,
                     title="Raw Train: Colon Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=timeinterval)

By Risk Categories

obsexp <- rrAnalysisTrain$OERatio$atThrEstimates

expObs(obsexp,"Train: Expected vs. Observed")

pander::pander(obsexp)
  Observed L.CI H.CI Expected O/E Low Upper pvalue
Total 315 281.2 351.8 460.2 0.684 0.611 0.764 9.07e-13
low 166 141.7 193.3 287.3 0.578 0.493 0.673 1.13e-14
90% 53 39.7 69.3 58.5 0.907 0.679 1.186 5.13e-01
80% 96 77.8 117.2 102.8 0.934 0.756 1.140 5.54e-01

Time to Event Analysis

rrAnalysisdata <- rrAnalysisTrain

pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime,rrAnalysisdata$timetoEventData$expectedTime,paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime and rrAnalysisdata$timetoEventData$expectedTime
Test statistic P value Alternative hypothesis
140586 7.43e-23 * * * two.sided
highrisk <- rrAnalysisdata$timetoEventData$class == 2
pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime[highrisk],rrAnalysisdata$timetoEventData$expectedTime[highrisk],paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime[highrisk] and rrAnalysisdata$timetoEventData$expectedTime[highrisk]
Test statistic P value Alternative hypothesis
4361 0.476 two.sided
timesdata <- expObsTime(rrAnalysisdata,title="Train: Expected vs Observed")

pander::pander(timesdata)
  O:Low Risk < 0.325 O:0.325 <= Risk < 0.423 O:High Risk >= 0.423 E:Low Risk < 0.325 E:0.325 <= Risk < 0.423 E:High Risk >= 0.423
1Q 1.71 0.681 0.511 2.81 1.96 1.18
Median 5.63 1.863 1.025 2.95 2.37 1.35
3Q 6.52 5.903 2.749 3.73 2.49 1.52

Uncalibrated Performance Report

pander::pander(t(rrAnalysisTrain$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.8 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.423 0.325 0.322 0.218 0.18014 0.5000
RR 1.697 1.754 1.796 2.642 1.00000 1.8102
RR_LCI 1.475 1.515 1.549 1.415 0.00000 1.5829
RR_UCI 1.952 2.030 2.083 4.934 0.00000 2.0701
SEN 0.308 0.476 0.502 0.975 1.00000 0.2254
SPE 0.895 0.797 0.788 0.105 0.00654 0.9510
BACC 0.602 0.637 0.645 0.540 0.50327 0.5882
NetBenefit 0.118 0.193 0.205 0.371 0.39970 0.0902
pander::pander(t(rrAnalysisTrain$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.684 0.611 0.764 9.07e-13
pander::pander(t(rrAnalysisTrain$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
1.14 1.14 1.12 1.16
pander::pander(t(rrAnalysisTrain$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
1.5 1.5 1.49 1.5
pander::pander(rrAnalysisTrain$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.665 0.666 0.636 0.693
pander::pander(t(rrAnalysisTrain$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.689 0.648 0.73
pander::pander((rrAnalysisTrain$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.305 0.254 0.359
pander::pander((rrAnalysisTrain$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.899 0.859 0.93
pander::pander(t(rrAnalysisTrain$thr_atP),caption="Probability Thresholds")
Probability Thresholds
90% 80%
0.423 0.325
pander::pander(rrAnalysisTrain$surdif,caption="Logrank test")
Logrank test Chisq = 96.652824 on 2 degrees of freedom, p = 0.000000
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 410 166 236.0 20.78 83.93
class=1 84 53 36.3 7.64 8.65
class=2 127 96 42.6 66.86 78.27

Cox Calibration

op <- par(no.readonly = TRUE)


calprob <- CoxRiskCalibration(ml,dataColonTrain,"status","time")

( 3.177691 , 3163.461 , 1.049847 , 315 , 524.8967 )

pander::pander(c(h0=calprob$h0,
                 Gain=calprob$hazardGain,
                 TimeInterval=calprob$timeInterval),
               caption="Cox Calibration Parameters")
h0 Gain TimeInterval
0.704 1.55 3.18

The RRplot() of the calibrated model

rCaldata <- cbind(dataColonTrain$status,calprob$prob)


rrAnalysisCalTrain <- RRPlot(rCaldata,atRate=c(0.90,0.80),
                     timetoEvent=dataColonTrain$time,
                     title="Calibrated Train: Colon",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=calprob$timeInterval)

By Risk Categories

obsexp <- rrAnalysisCalTrain$OERatio$atThrEstimates

expObs(obsexp,"Cal: Expected vs. Observed")

pander::pander(obsexp)
  Observed L.CI H.CI Expected O/E Low Upper pvalue
Total 315 281.2 351.8 517.9 0.608 0.543 0.679 9.50e-22
low 166 141.7 193.3 323.4 0.513 0.438 0.598 7.53e-22
90% 52 38.8 68.2 62.5 0.832 0.621 1.091 2.05e-01
80% 97 78.7 118.3 119.0 0.815 0.661 0.994 4.36e-02

Time to Event Analysis

rrAnalysisdata <- rrAnalysisCalTrain

pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime,rrAnalysisdata$timetoEventData$expectedTime,paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime and rrAnalysisdata$timetoEventData$expectedTime
Test statistic P value Alternative hypothesis
148049 1.17e-30 * * * two.sided
highrisk <- rrAnalysisdata$timetoEventData$class == 2
pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime[highrisk],rrAnalysisdata$timetoEventData$expectedTime[highrisk],paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime[highrisk] and rrAnalysisdata$timetoEventData$expectedTime[highrisk]
Test statistic P value Alternative hypothesis
4957 0.0725 two.sided
timesdata <- expObsTime(rrAnalysisdata,title="Cal: Expected vs Observed")

pander::pander(timesdata)
  O:Low Risk < 0.505 O:0.505 <= Risk < 0.626 O:High Risk >= 0.626 E:Low Risk < 0.505 E:0.505 <= Risk < 0.626 E:High Risk >= 0.626
1Q 1.71 0.671 0.515 2.50 1.77 1.05
Median 5.63 1.723 1.052 2.62 2.11 1.20
3Q 6.52 5.921 3.600 3.31 2.21 1.36

Calibrated Train Performance

pander::pander(t(rrAnalysisTrain$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.8 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.423 0.325 0.322 0.218 0.18014 0.5000
RR 1.697 1.754 1.796 2.642 1.00000 1.8102
RR_LCI 1.475 1.515 1.549 1.415 0.00000 1.5829
RR_UCI 1.952 2.030 2.083 4.934 0.00000 2.0701
SEN 0.308 0.476 0.502 0.975 1.00000 0.2254
SPE 0.895 0.797 0.788 0.105 0.00654 0.9510
BACC 0.602 0.637 0.645 0.540 0.50327 0.5882
NetBenefit 0.118 0.193 0.205 0.371 0.39970 0.0902
pander::pander(t(rrAnalysisTrain$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.684 0.611 0.764 9.07e-13
pander::pander(t(rrAnalysisTrain$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
1.14 1.14 1.12 1.16
pander::pander(t(rrAnalysisTrain$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
1.5 1.5 1.49 1.5
pander::pander(rrAnalysisTrain$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.665 0.666 0.636 0.693
pander::pander(t(rrAnalysisTrain$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.689 0.648 0.73
pander::pander((rrAnalysisTrain$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.305 0.254 0.359
pander::pander((rrAnalysisTrain$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.899 0.859 0.93
pander::pander(t(rrAnalysisTrain$thr_atP),caption="Probability Thresholds")
Probability Thresholds
90% 80%
0.423 0.325
pander::pander(rrAnalysisTrain$surdif,caption="Logrank test")
Logrank test Chisq = 96.652824 on 2 degrees of freedom, p = 0.000000
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 410 166 236.0 20.78 83.93
class=1 84 53 36.3 7.64 8.65
class=2 127 96 42.6 66.86 78.27

Evaluating on the test set

The calibrated h0 and timeinterval were estimated on the training set

index <- predict(ml,dataColonTest)
rdata <- cbind(dataColonTest$status,ppoisGzero(index,calprob$h0))

rrAnalysisTest <- RRPlot(rdata,atThr = rrAnalysisCalTrain$thr_atP,
                     timetoEvent=dataColonTest$time,
                     title="Test: Colon Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=calprob$timeInterval)

By Risk Categories

obsexp <- rrAnalysisTest$OERatio$atThrEstimates

expObs(obsexp,"Test: Expected vs. Observed")

pander::pander(obsexp)
  Observed L.CI H.CI Expected O/E Low Upper pvalue
Total 131 109.53 155.4 235.8 0.555 0.464 0.659 1.22e-13
low 73 57.22 91.8 132.7 0.550 0.431 0.692 2.43e-08
90% 14 7.65 23.5 22.8 0.613 0.335 1.028 7.38e-02
80% 44 31.97 59.1 89.5 0.491 0.357 0.660 1.47e-07

Time to Event Analysis

rrAnalysisdata <- rrAnalysisTest

pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime,rrAnalysisdata$timetoEventData$expectedTime,paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime and rrAnalysisdata$timetoEventData$expectedTime
Test statistic P value Alternative hypothesis
28275 1.98e-16 * * * two.sided
highrisk <- rrAnalysisdata$timetoEventData$class == 2
pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime[highrisk],rrAnalysisdata$timetoEventData$expectedTime[highrisk],paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime[highrisk] and rrAnalysisdata$timetoEventData$expectedTime[highrisk]
Test statistic P value Alternative hypothesis
1724 0.000261 * * * two.sided
timesdata <- expObsTime(rrAnalysisdata,title="Test: Expected vs Observed")

pander::pander(timesdata)
  O:Low Risk < 0.505 O:0.505 <= Risk < 0.626 O:High Risk >= 0.626 E:Low Risk < 0.505 E:0.505 <= Risk < 0.626 E:High Risk >= 0.626
1Q 1.48 0.742 0.64 2.48 1.85 0.999
Median 5.26 2.171 1.67 2.58 2.17 1.203
3Q 6.62 6.556 5.39 3.35 2.22 1.304

Test Performance

pander::pander(t(rrAnalysisTest$keyPoints),caption="Threshold values")
Threshold values
  @:0.626 @:0.505 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.625 0.5043 0.463 0.364 3.49e-01 0.5004
RR 1.480 1.5081 2.049 5.223 1.99e+01 1.5006
RR_LCI 1.169 1.1919 1.503 1.395 4.37e-02 1.1838
RR_UCI 1.874 1.9083 2.793 19.555 9.07e+03 1.9021
SEN 0.336 0.4504 0.748 0.985 1.00e+00 0.4733
SPE 0.824 0.7426 0.559 0.132 2.94e-02 0.7206
BACC 0.580 0.5965 0.653 0.559 5.15e-01 0.5969
NetBenefit 0.015 0.0877 0.173 0.230 2.26e-01 0.0897
pander::pander(t(rrAnalysisTest$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.555 0.464 0.659 1.22e-13
pander::pander(t(rrAnalysisTest$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
0.913 0.914 0.888 0.94
pander::pander(t(rrAnalysisTest$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
0.944 0.945 0.935 0.954
pander::pander(rrAnalysisTest$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.638 0.639 0.596 0.685
pander::pander(t(rrAnalysisTest$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.68 0.616 0.744
pander::pander((rrAnalysisTest$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.336 0.256 0.424
pander::pander((rrAnalysisTest$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.831 0.757 0.89
pander::pander(t(rrAnalysisTest$thr_atP),caption="Probability Thresholds")
Probability Thresholds
90% 80%
0.626 0.505
pander::pander(rrAnalysisTest$surdif,caption="Logrank test")
Logrank test Chisq = 15.249364 on 2 degrees of freedom, p = 0.000488
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 174 73 92.4 4.059 13.827
class=1 26 14 11.6 0.506 0.555
class=2 67 44 27.1 10.609 13.430

Cross-Validation

Here we will cross validate the training set and evaluate also on the testing set. The h0 and the timeinterval are the ones estimated on the calibration process

rcv <- randomCV(theData=dataColonTrain,
                theOutcome = Surv(time,status)~1,
                fittingFunction=BSWiMS.model, 
                trainFraction = 0.75,
                repetitions=50,
                classSamplingType = "Pro",
                testingSet=dataColonTest
         )
## Installing package into '/home/jose/R/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
## also installing the dependencies 'shape', 'lars'
## Installing package into '/home/jose/R/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)

.[+++-].[+++-].[+++].[+++].[+++-].[++++-].[++++++].[+++++].[++].[+++-]10 Tested: 853 Avg. Selected: 7.7 Min Tests: 1 Max Tests: 10 Mean Tests: 4.958968 . MAD: 0.4708303

.[++++-].[++-].[++++–].[++++-].[++-].[++++-].[++-].[++++++].[+++++].[+++++]20 Tested: 887 Avg. Selected: 7.6 Min Tests: 1 Max Tests: 20 Mean Tests: 9.537768 . MAD: 0.4715452

.[+++–].[++++-].[+++-].[++-].[+++++].[++-].[++].[+++-].[+++-].[+++++++]30 Tested: 888 Avg. Selected: 7.533333 Min Tests: 1 Max Tests: 30 Mean Tests: 14.29054 . MAD: 0.4709235

.[++++].[+++].[+++-].[++++++].[+++-].[+++-].[+++-].[+++++].[+++].[+++]40 Tested: 888 Avg. Selected: 7.675 Min Tests: 2 Max Tests: 40 Mean Tests: 19.05405 . MAD: 0.4707018

.[+++-].[+++].[+++].[+++-].[++-].[++++-].[++++].[+++].[+++++].[+++++++]50 Tested: 888 Avg. Selected: 7.62 Min Tests: 4 Max Tests: 50 Mean Tests: 23.81757 . MAD: 0.4710485

stp <- rcv$survTestPredictions
stp <- stp[!is.na(stp[,4]),]

bbx <- boxplot(unlist(stp[,1])~rownames(stp),plot=FALSE)
times <- bbx$stats[3,]
status <- boxplot(unlist(stp[,2])~rownames(stp),plot=FALSE)$stats[3,]
prob <- ppoisGzero(boxplot(unlist(stp[,4])~rownames(stp),plot=FALSE)$stats[3,],calprob$h0)

rdatacv <- cbind(status,prob)
rownames(rdatacv) <- bbx$names
names(times) <- bbx$names

rrAnalysisCVTest <- RRPlot(rdatacv,atThr = rrAnalysisCalTrain$thr_atP,
                     timetoEvent=times,
                     title="CV Test: Colon Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=calprob$timeInterval)

By Risk Categories

obsexp <- rrAnalysisCVTest$OERatio$atThrEstimates

expObs(obsexp,"CV: Expected vs. Observed")

pander::pander(obsexp)
  Observed L.CI H.CI Expected O/E Low Upper pvalue
Total 446 405.6 489.4 794 0.561 0.510 0.616 2.86e-41
low 226 197.5 257.5 453 0.499 0.436 0.569 6.50e-32
90% 73 57.2 91.8 106 0.688 0.539 0.865 8.00e-04
80% 147 124.2 172.8 221 0.664 0.561 0.780 1.26e-07

Time to Event Analysis

rrAnalysisdata <- rrAnalysisCVTest

pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime,rrAnalysisdata$timetoEventData$expectedTime,paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime and rrAnalysisdata$timetoEventData$expectedTime
Test statistic P value Alternative hypothesis
308708 4.73e-48 * * * two.sided
highrisk <- rrAnalysisdata$timetoEventData$class == 2
pander::pander(wilcox.test(rrAnalysisdata$timetoEventData$eTime[highrisk],rrAnalysisdata$timetoEventData$expectedTime[highrisk],paired = TRUE))
Wilcoxon signed rank test with continuity correction: rrAnalysisdata$timetoEventData$eTime[highrisk] and rrAnalysisdata$timetoEventData$expectedTime[highrisk]
Test statistic P value Alternative hypothesis
13396 0.000283 * * * two.sided
timesdata <- expObsTime(rrAnalysisdata,title="CV: Expected vs Observed")

pander::pander(timesdata)
  O:Low Risk < 0.505 O:0.505 <= Risk < 0.626 O:High Risk >= 0.626 E:Low Risk < 0.505 E:0.505 <= Risk < 0.626 E:High Risk >= 0.626
1Q 1.63 0.764 0.575 2.45 1.89 1.02
Median 5.56 2.652 1.153 2.59 2.14 1.18
3Q 6.62 6.000 4.989 3.19 2.20 1.33

CV Test Performance

pander::pander(t(rrAnalysisCVTest$keyPoints),caption="Threshold values")
Threshold values
  @:0.626 @:0.505 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.6248 0.505 0.473 0.379 0.30974 0.500
RR 1.6484 1.654 1.780 2.228 1.00000 1.652
RR_LCI 1.4612 1.458 1.528 1.538 0.00000 1.453
RR_UCI 1.8596 1.876 2.072 3.226 0.00000 1.877
SEN 0.3296 0.493 0.697 0.951 1.00000 0.518
SPE 0.8710 0.753 0.570 0.158 0.00226 0.731
BACC 0.6003 0.623 0.634 0.555 0.50113 0.624
NetBenefit 0.0587 0.122 0.158 0.222 0.27944 0.126
pander::pander(t(rrAnalysisCVTest$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.561 0.51 0.616 2.86e-41
pander::pander(t(rrAnalysisCVTest$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
0.939 0.939 0.925 0.954
pander::pander(t(rrAnalysisCVTest$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
0.988 0.988 0.986 0.99
pander::pander(rrAnalysisCVTest$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.649 0.648 0.623 0.672
pander::pander(t(rrAnalysisCVTest$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.675 0.64 0.71
pander::pander((rrAnalysisCVTest$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.33 0.286 0.375
pander::pander((rrAnalysisCVTest$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.873 0.839 0.903
pander::pander(t(rrAnalysisCVTest$thr_atP),caption="Probability Thresholds")
Probability Thresholds
90% 80%
0.626 0.505
pander::pander(rrAnalysisCVTest$surdif,caption="Logrank test")
Logrank test Chisq = 105.886138 on 2 degrees of freedom, p = 0.000000
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 560 226 315.7 25.49 87.98
class=1 125 73 57.3 4.31 4.95
class=2 203 147 73.0 75.01 90.52